//封装localStorage
//定义常量用于接收token
const TOKEN_NEWS = 'token-news'

//存储token
let saveToken = obj => {
    localStorage.setItem(TOKEN_NEWS, JSON.stringify(obj))
}

//获取token
let getToken = () => {
    return JSON.parse(localStorage.getItem(TOKEN_NEWS))
}

//删除token
let removeToken = () => {
    localStorage.removeItem(TOKEN_NEWS)
}

export { saveToken, getToken, removeToken }